include(arm-none-eabi-gcc)

set(MCU -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard)
set(OPT -Og)

SET(AFLAGS ${MCU} ${OPT} -Wall -fdata-sections -ffunction-sections)
SET(CFLAGS ${MCU} ${OPT} -Wall -fdata-sections -ffunction-sections)
SET(LDFLAGS ${MCU} $(MCU) -specs=nano.specs -Wl,--gc-sections)

add_compile_options(
    ${MCU} ${OPT}
    -Wall -fdata-sections -ffunction-sections
)